export class userlevel {
  id?: number;
  name = '';
  experience = '';
  grade = '';
  discount = '';
  isDel = false
  icon = "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg"
  isShow = true

  constructor(data?: userlevel) {
    data && this.setProps(data);
  }

  setProps(data: userlevel) {
    (Object.keys(this) as Array<keyof Iuserlevel>).forEach((key) => {
      // @ts-ignore
      this[key] = data[key]
    })
  }
}

export type Iuserlevel = Omit<userlevel, 'setProps'>